package stz.flash;

import stz.flash.string.OptionString;
import net.rim.device.api.applicationcontrol.ApplicationPermissions;
import net.rim.device.api.system.DeviceInfo;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Ui;
import blackberry.info.DjDeviceNames;

/**
 * OS6, OS7용 버젼 지원 해상도
 * 640x480, 480x360, 480x800, 480x640, 360x480, 360x400, 320x240
 *
 */

public class Info{
	
	//cod파일 이름
	public static final String FILE_NAME_OF_APPLICATION = "MonkeyFlash";
	
	//Key
	public static final long OPTION_PERSISTENT_KEY = 0x6a38df1ef5bb044fL;
	
	//Permissions
	public static final int[] REQUEST_PERMISSIONS = new int[] {
		ApplicationPermissions.PERMISSION_IDLE_TIMER,
		ApplicationPermissions.PERMISSION_INPUT_SIMULATION,//가상 키 입력
		ApplicationPermissions.PERMISSION_RECORDING//Screenshot
		};
	
	//Software Version
	public static final int SOFTWARE_VERSION; 
	static{
		if (DeviceInfo.getSoftwareVersion().regionMatches(false, 0, "7", 0, 1))
			SOFTWARE_VERSION = 7;
		else if (DeviceInfo.getSoftwareVersion().regionMatches(false, 0, "6", 0, 1))
			SOFTWARE_VERSION = 6;
		else if (DeviceInfo.getSoftwareVersion().regionMatches(false, 0, "5", 0, 1))
			SOFTWARE_VERSION = 5;
		else 
			SOFTWARE_VERSION = 4;
	}
	
	//GlobalKey
	public static final String[] STRING_ARR_OF_GLOBAL_KEYS;
	static {
		if (isPearl3G()) {
			
			STRING_ARR_OF_GLOBAL_KEYS = new String[] {
					OptionString.MUTE_KEY, 
					OptionString.BACKWARD_KEY, 
					OptionString.FORWARD_KEY, 
					OptionString.VOLUME_UP_KEY, 
					OptionString.VOLUME_DOWN_KEY,
					OptionString.END_KEY,
					OptionString.NONE
			};
		} else {
			
			STRING_ARR_OF_GLOBAL_KEYS = new String[] {
					OptionString.MUTE_KEY, 
					OptionString.VOLUME_UP_KEY, 
					OptionString.VOLUME_DOWN_KEY,
					OptionString.END_KEY,
					OptionString.NONE};
		}
	}
	
	public static final String[] STROBE_TOGGLE_KEYS;
	static {
		if (isPearl3G()) {

			STROBE_TOGGLE_KEYS = new String[] {
					OptionString.BACKWARD_KEY, 
					OptionString.FORWARD_KEY 
			};
		} else {
			
			STROBE_TOGGLE_KEYS = new String[] {
					OptionString.MUTE_KEY
			};
		}
	}
		
	//HomeScreen Hotkey
	public static final String ALPHABET_A = "A";
	public static final String ALPHABET_B = "B";
	public static final String ALPHABET_C = "C";
	public static final String ALPHABET_D = "D";
	public static final String ALPHABET_E = "E";
	public static final String ALPHABET_F = "F";
	public static final String ALPHABET_G = "G";
	public static final String ALPHABET_H = "H";
	public static final String ALPHABET_I = "I";
	public static final String ALPHABET_J = "J";
	public static final String ALPHABET_K = "K";
	public static final String ALPHABET_L = "L";
	public static final String ALPHABET_M = "M";
	public static final String ALPHABET_N = "N";
	public static final String ALPHABET_O = "O";
	public static final String ALPHABET_P = "P";
	public static final String ALPHABET_Q = "Q";
	public static final String ALPHABET_R = "R";
	public static final String ALPHABET_S = "S";
	public static final String ALPHABET_T = "T";
	public static final String ALPHABET_U = "U";
	public static final String ALPHABET_V = "V";
	public static final String ALPHABET_W = "W";
	public static final String ALPHABET_X = "X";
	public static final String ALPHABET_Y = "Y";
	public static final String ALPHABET_Z = "Z";
	public static final String KEY_SPACE = "Space";
	
	public static final String[] getHomeScreenHotkeyList() {
		return (isPearl3G()) ?
						
						new String[] { 
							OptionString.NONE, KEY_SPACE, ALPHABET_A, ALPHABET_B,
							ALPHABET_C, ALPHABET_D, ALPHABET_E,
							ALPHABET_G, ALPHABET_J, ALPHABET_L, 
							ALPHABET_M, ALPHABET_O, ALPHABET_Q,
							ALPHABET_T, ALPHABET_U, ALPHABET_Z,

						} : new String[] {
								
							OptionString.NONE, KEY_SPACE, ALPHABET_A, ALPHABET_B,
							ALPHABET_C, ALPHABET_D, ALPHABET_E,
							ALPHABET_F, ALPHABET_G, ALPHABET_H,
							ALPHABET_I, ALPHABET_J, ALPHABET_K,
							ALPHABET_L, ALPHABET_M, ALPHABET_N,
							ALPHABET_O, ALPHABET_P, ALPHABET_Q,
							ALPHABET_R, ALPHABET_S, ALPHABET_T,
							ALPHABET_U, ALPHABET_V, ALPHABET_W,
							ALPHABET_X, ALPHABET_Y, ALPHABET_Z,
						};
								
	}
	public static boolean isPearl3G() {
		return DjDeviceNames.getName() == DjDeviceNames.PEARL_3G_9105 || DjDeviceNames
				.getName() == DjDeviceNames.PEARL_3G_9100;
	}
	
	//길이 관련
	public static final int PX_OF_1MM = Ui.convertSize(1, Ui.UNITS_mm, Ui.UNITS_px);
	public static final int PX_OF_2MM = Ui.convertSize(2, Ui.UNITS_mm, Ui.UNITS_px);
	public static final int PX_OF_3MM = Ui.convertSize(3, Ui.UNITS_mm, Ui.UNITS_px);
	public static final int PX_OF_4MM = Ui.convertSize(4, Ui.UNITS_mm, Ui.UNITS_px);
	

	//색깔 관련
	public static final int COLOR_OF_FOCUS = Color.YELLOW;
	public static final int COLOR_OF_SELECT = Color.YELLOWGREEN;
	public static final int GLOBAL_ALPHA_OF_HIGHLIGHT = 100;
}
